import { defHttp } from "/@/utils/http/axios"
import { Modal } from "ant-design-vue"

export const pagePost = (params) => {
  return defHttp.get({ url: "/iam-service/post/page", params })
}

export const listPost = (params) => {
  return defHttp.get({ url: "/iam-service/post/list", params })
}


export const saveOrUpdatePost = (params, isUpdate) => {
  const url = isUpdate ? "/iam-service/post/update" : "/iam-service/post/save"
  return defHttp.post({ url: url, params })
}

export const getPostById = (params) => {
  return defHttp.get({ url: "/iam-service/post/get", params })
}


export const deletePost = (params, handleSuccess) => {
  return defHttp.delete({ url: "/iam-service/post/delete", data: params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess()
  })
}
